package com.teensoft.core.user.imp;

import com.teensoft.base.dao.imp.HibernateDAO;
import com.teensoft.base.exception.DAOException;
import com.teensoft.core.user.Resource;
import com.teensoft.core.user.ResourceDAO;

public class ResourceDAOImp extends HibernateDAO implements ResourceDAO {

	public void addResource(Resource resource) throws DAOException {
		this.saveOrUpdate(resource);
	}

	public void deleteResourceById(String id) throws DAOException {
		this.delete(Resource.class, id);
	}

	public Resource getById(String id) throws DAOException {
		return (Resource)this.get(Resource.class, id);
	}

	public void updateResource(Resource resource) throws DAOException {
		this.saveOrUpdate(resource);
	}

}
